package com.tianqu.tms.entity;

import com.tianqu.tms.core.base.TmsEntity;
import com.tianqu.tms.core.exception.TmsDaoException;
import com.tianqu.tms.core.exception.TmsException;
import com.tianqu.tms.dao.TmsChangeDao;
import com.tianqu.tms.dao.TmsDao;
import com.tianqu.tms.dto.TmsChangeDto;

public class TmsChange extends TmsEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7918598003539777877L;

	private int id;// 主键ID
	private String serial;// 车辆流水号
	private int printType;// 打印类型
	private String ownerIdCardNo;// 变更车主身份证号
	private String ownerAddress;// 变更车主住址
	private String ownerPhone;// 变更车主手机号码
	private int ownerZipCode;// 变更车主邮编
	private String mailAddress;// 变更车主邮寄地址
	private String moveOutProvince;// 变更迁出管理所（省
	private String moveOutCity;// 变更迁出管理所（市）
	private int insertUserId;// 插入用户
	private String ownerName;//变更机动车所有人姓名/名称
	private String ownerTel;//共同所有的机动车变更所有人
	


	
	
	public static TmsChange getInstance() {
		TmsChange carInfo = new TmsChange();
		carInfo.setExisting(false);
		return carInfo;
	}
	
	
	public void insertChangeInfo(TmsChange entity) throws TmsDaoException
	{
		TmsChangeDao uDao = (TmsChangeDao) TmsDao.getInstance(TmsDao.TMS_CHANGE);
		TmsChangeDto dto = new TmsChangeDto();
		dto=setDtoFromEntity(dto, entity); 
		uDao.insertChangeInfo(dto);
	}
	/**
	 * entity - > dto
	 * @return
	 */
	private TmsChangeDto setDtoFromEntity(TmsChangeDto dto,TmsChange entity)
	{
		dto.setSerial(entity.getSerial());
		dto.setPrintType(entity.getPrintType());
		dto.setOwnerIdCardNo(entity.getOwnerIdCardNo());
		dto.setOwnerAddress(entity.getOwnerAddress());
		dto.setOwnerPhone(entity.getOwnerPhone());
		dto.setOwnerZipCode(entity.getOwnerZipCode());
		dto.setMailAddress(entity.getMailAddress());
		dto.setMoveOutProvince(entity.getMoveOutProvince());
		dto.setMoveOutCity(entity.getMoveOutCity());
		dto.setInsertUserId(entity.getInsertUserId());
		return dto;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getSerial() {
		return serial;
	}

	public void setSerial(String serial) {
		this.serial = serial;
	}

	public int getPrintType() {
		return printType;
	}

	public void setPrintType(int printType) {
		this.printType = printType;
	}

	public String getOwnerIdCardNo() {
		return ownerIdCardNo;
	}

	public void setOwnerIdCardNo(String ownerIdCardNo) {
		this.ownerIdCardNo = ownerIdCardNo;
	}

	public String getOwnerAddress() {
		return ownerAddress;
	}

	public void setOwnerAddress(String ownerAddress) {
		this.ownerAddress = ownerAddress;
	}

	public String getOwnerPhone() {
		return ownerPhone;
	}

	public void setOwnerPhone(String ownerPhone) {
		this.ownerPhone = ownerPhone;
	}

	public int getOwnerZipCode() {
		return ownerZipCode;
	}

	public void setOwnerZipCode(int ownerZipCode) {
		this.ownerZipCode = ownerZipCode;
	}

	public String getMailAddress() {
		return mailAddress;
	}

	public void setMailAddress(String mailAddress) {
		this.mailAddress = mailAddress;
	}

	public String getMoveOutProvince() {
		return moveOutProvince;
	}

	public void setMoveOutProvince(String moveOutProvince) {
		this.moveOutProvince = moveOutProvince;
	}

	public String getMoveOutCity() {
		return moveOutCity;
	}

	public void setMoveOutCity(String moveOutCity) {
		this.moveOutCity = moveOutCity;
	}

	public int getInsertUserId() {
		return insertUserId;
	}

	public void setInsertUserId(int insertUserId) {
		this.insertUserId = insertUserId;
	}

	public String getOwnerName() {
		return ownerName;
	}


	public void setOwnerName(String ownerName) {
		this.ownerName = ownerName;
	}


	public String getOwnerTel() {
		return ownerTel;
	}


	public void setOwnerTel(String ownerTel) {
		this.ownerTel = ownerTel;
	}


	@Override
	public void save() throws TmsDaoException, TmsException {
		// TODO Auto-generated method stub

	}

}
